package view.impl;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;

import butterknife.ButterKnife;
import butterknife.InjectView;
import cqut.edu.cn.temp_20160410.R;
import view.IUserRegisterView;

/**
 * 用户注册
 */
public class RegisterActivity extends Activity implements OnClickListener , IUserRegisterView {

	@InjectView(R.id.ivRegback)
	ImageView mIvBack;// 返回
	@InjectView(R.id.btnSubmit)
	Button mBtnSubmit;// 提交
	@InjectView(R.id.btnReset)
	Button mBtnReset;// 重置
	@InjectView(R.id.etRegLoginName)
	EditText mLoginName;//昵称
	@InjectView(R.id.etRegUname)
	EditText mUsername;//用户名
	@InjectView(R.id.etPasswd)
	EditText mPasswd;//密码
	@InjectView(R.id.etRegRpasswd)
	EditText mRpasswd;//确认密码
	@InjectView(R.id.rgSex)
	RadioGroup mSex;//性别
	@InjectView(R.id.rbMale)
	RadioButton rbMale;
	@InjectView(R.id.rbFemale)
	RadioButton rbFemale;
	@InjectView(R.id.etBirthday)
	EditText mBirthday;//生日
	@InjectView(R.id.etSignature)
	EditText mSignature;//个性签名
	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ButterKnife.inject(this);
		setContentView(R.layout.register);

		init();
	}

	//��ʼ��view
	public void init() {
		addListener();
	}

	//��Ӽ���
	public void addListener() {
		mBtnSubmit.setOnClickListener(this);
		mBtnReset.setOnClickListener(this);
	}

	public void back(View view) {
		Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
		startActivity(intent);
	}

	@Override
	public void onClick(View view) {
		int id = view.getId();
		switch (id) {
		case R.id.btnSubmit:

			break;
		case R.id.btnReset:

			break;
		default:
			break;
		}
	}

	@Override
	public void clearAll() {
		mLoginName.setText("");
		mUsername.setText("");
		mPasswd.setText("");
		mRpasswd.setText("");
		rbMale.setChecked(true);
		mBirthday.setText("");
		mSignature.setText("");
	}

	@Override
	public void onSubmit() {
		startActivity(new Intent(RegisterActivity.this,RegisterSuccess.class));
	}

	@Override
	public boolean check() {
		return false;
	}
}
